cmake_minimum_required(VERSION 3.10)
project(CV_CAL)

#opencv
find_package(OpenCV REQUIRED)

#查找 pkg-config
find_package(PkgConfig REQUIRED)

# 使用 pkg-config 查找 ZBar
pkg_check_modules(ZBAR REQUIRED IMPORTED_TARGET zbar)
# 使用 pkg-config 查找 ZXing
pkg_check_modules(ZXING REQUIRED IMPORTED_TARGET zxing)

include_directories(
        ${OpenCV_INCLUDE_DIRS}
        ${ZBAR_INCLUDE_DIRS}
)

# 自动收集 src/ 目录下的所有 .cpp 文件
set(SRC_FILES
    src/main.cpp
    src/processor/DefaultProcessor.cpp
    # 添加其他 .cpp 文件
    src/processor/CardProcessor.cpp
    src/processor/CardPickProcessor.cpp
    src/processor/CardParamPickProcessor.cpp
    src/processor/QRDetector.cpp
    src/processor/QRPickDetector.cpp)
add_executable(demo src/main.cpp  ${SRC_FILES})

# 添加头文件路径
target_include_directories(demo PRIVATE include)
target_link_libraries(demo ${OpenCV_LIBS} PkgConfig::ZBAR PkgConfig::ZXING)

# 添加测试子目录
 add_subdirectory(test)

# 本地调试目录
# add_subdirectory(debug)
